package com.qk.management.mapper;


import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RoleMapper {
    List<Role> getRoles(Role role);


    @Delete("delete from role where id = #{id}")
    void deleteRole(Integer id);

    @Insert("insert into role(name,label,update_time,create_time) values(#{name},#{label},#{updateTime},#{createTime})")
    void addRole(Role role);

    @Select("select * from role where id = #{id}")
    Role getRoleById(Integer id);

    @Update("update role set name=#{name},label=#{label},update_time=#{updateTime} where id=#{id}")
    void updateRole(Role role);

    @Select("select * from role")
    List<Role> selectAll();

    @Select("select * from role where label = #{roleLabel}")
    Role selectByLabel(String roleLabel);
}
